{temp('admin/head')}
<!-- 以下是art弹窗js -->
<script src="{$adstyle}/js/art/artDialog.source.js?skin=opera"></script>
<script src="{$adstyle}/js/art/plugins/iframeTools.source.js"></script>

</head>
<body class="page-body">
		
		{temp('admin/left')}
			
			{temp('admin/top')}
			
			{if(@$r['id'])}
			<div class="row">
				<div class="col-sm-12">
					
					<div class="panel panel-default">
						<div class="panel-heading">
							<h3 class="panel-title">{$tit}</h3>
						</div>
						<div class="panel-body">
							
							<form role="form" class="form-horizontal">
								
								<div class="form-group">
									<label class="col-sm-2 control-label">用户名</label>
									<div class="col-sm-4">
										<div class="form-control" style="border:0px;padding-left:0px;">{if(@$r['username'])}{$r['username']}{/if}</div>
									</div>
								</div>
								
								<div class="form-group-separator"></div>
								
								<div class="form-group">
									<label class="col-sm-2 control-label" for="pwd">密码</label>
									<div class="col-sm-4">
										<input type="password" class="form-control" id="pwd" value="" placeholder="如果留空表示密码不修改">
									</div>
								</div>
								
								<div class="form-group-separator"></div>
								
								<div class="form-group">
									<label class="col-sm-2 control-label" for="name">姓名</label>
									<div class="col-sm-4">
										<input type="text" class="form-control" id="name" value="{if(@$r['name'])}{$r['name']}{/if}">
									</div>
								</div>
								
								<div class="form-group-separator"></div>
								
								<div class="form-group">
									<label class="col-sm-2 control-label" for="touxiang">权限</label>
										<div class="col-sm-10" style="padding-left:6px;">
											<p>
												<label class="checkbox-inline" style="margin-left:10px;">
													<input type="checkbox" value="1" name="qx" id="gn_1" {if(in_array(1,$r['qx']))}checked="checked"{/if} />
													用户管理
												</label>
												<label class="checkbox-inline" style="margin-left:10px;">
													<input type="checkbox" value="2" name="qx" id="gn_2" {if(in_array(2,$r['qx']))}checked="checked"{/if} />
													审核
												</label>
												<label class="checkbox-inline" style="margin-left:10px;">
													<input type="checkbox" value="3" name="qx" id="gn_3" {if(in_array(3,$r['qx']))}checked="checked"{/if} />
													反馈
												</label>
												<label class="checkbox-inline" style="margin-left:10px;">
													<input type="checkbox" value="4" name="qx" id="gn_4" {if(in_array(4,$r['qx']))}checked="checked"{/if} />
													推送
												</label>
												<label class="checkbox-inline" style="margin-left:10px;">
													<input type="checkbox" value="5" name="qx" id="gn_5" {if(in_array(5,$r['qx']))}checked="checked"{/if} />
													新闻管理
												</label>
												<label class="checkbox-inline" style="margin-left:10px;">
													<input type="checkbox" value="6" name="qx" id="gn_6" {if(in_array(6,$r['qx']))}checked="checked"{/if} />
													聊天记录
												</label>
												<label class="checkbox-inline" style="margin-left:10px;">
													<input type="checkbox" value="7" name="qx" id="gn_7" {if(in_array(7,$r['qx']))}checked="checked"{/if} />
													找回密码
												</label>
											</p>
										</div>
								</div>
								
								<div class="form-group-separator"></div>
								
								<div class="form-group">
									<div class="col-sm-10">
										<button class="btn btn-info btn-single pull-right" onClick="tijiao({$r['id']})" type="button">提交</button>
									</div>
								</div>
							</form>
							
						</div>
					</div>
					
				</div>
			</div>
			{/if}
			
			<script>
			function tijiao(id){
				var pwd = $("#pwd").val();
				var name = $("#name").val();
				var qx =[];//定义一个数组
				$('input[name="qx"]:checked').each(function(){//遍历每一个名字为interest的复选框，其中选中的执行函数
					qx.push($(this).val());//将选中的值添加到数组chk_value中
				});
				$.post('{$_url}/admin/?act=recruit&met=kefu_bj{$gnpd}',{id:id,pwd:pwd,name:name,qx:qx},function(data){
						showAjaxModal(data);
						if(data == '修改成功'){
							$("#queding").attr("onclick","tiao('{$_url}/admin/?act=recruit&met=kefu&id={$r['id']}{$gnpd}')");
						}
				});
			}
			function showAjaxModal(data){//ajax弹窗
				jQuery('#modal-7').modal('show', {backdrop: 'static'});
				jQuery('#modal-7 .modal-body').html(data);
			}
			function tiao(url){//创建成功跳转
				window.location.href=url;
			}
			</script>
			
		{temp('admin/foot')}
	
	<!-- Modal 7 (Ajax Modal)-->
	<div class="modal fade" id="modal-7">
		<div class="modal-dialog">
			<div class="modal-content">
				<div class="modal-header">
					<button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
					<h4 class="modal-title">{$tit}</h4>
				</div>
				<div class="modal-body">
					Content is loading...
				</div>
				<div class="modal-footer">
					<button type="button" class="btn btn-info" data-dismiss="modal" id="queding">确定</button>
				</div>
			</div>
		</div>
	</div>
	
	<!-- Bottom Scripts -->
	<script src="{$adstyle}/js/bootstrap.min.js"></script>
	<script src="{$adstyle}/js/TweenMax.min.js"></script>
	<script src="{$adstyle}/js/resizeable.js"></script>
	<script src="{$adstyle}/js/joinable.js"></script>
	<script src="{$adstyle}/js/xenon-api.js"></script>
	<script src="{$adstyle}/js/xenon-toggles.js"></script>

	<!-- Imported scripts on this page -->
	<script src="{$adstyle}/js/datepicker/bootstrap-datepicker.js"></script>

	<!-- JavaScripts initializations and stuff -->
	<script src="{$adstyle}/js/xenon-custom.js"></script>

</body>
</html>